package List;

import javax.sql.rowset.serial.SerialStruct;
import java.util.*;
import java.util.stream.Collectors;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:岁亮亮
 * Date:2024-05-15
 * TIME:16:28
 */
public class ArrayTest {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();
        LinkedList<String> list1 = new LinkedList<>();
        LinkedList<LinkedList<String>> list2 = new LinkedList<>();
    }
    public static void main4(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>(15);
        ArrayList<String> arrayList1 = new ArrayList<>(arrayList);
        Queue<Number> queue = new LinkedList<>();
        queue.add(1);
        queue.add(1);
        queue.add(1);
        ArrayList<Number> arrayList2 = new ArrayList<>(queue);
       /* System.out.println(arrayList2);*/
       ListIterator<Number> list = arrayList2.listIterator();

      Iterator<Number> lis = arrayList2.iterator();
       /* arrayList.add("a");
        arrayList.add("a");
        arrayList.add("a");
        arrayList.add("a");
        for (int i = 0; i < arrayList.size(); i++) {
            System.out.println(arrayList.get(i));
        }
        System.out.println();
        System.out.println(arrayList);*/
    }
    public static void main3(String[] args) {
       /* String[] str = {"123","234","3455","456"};
        ArrayList<String> arrayList = new ArrayList<>(Arrays.asList(str));
        arrayList.addAll(Arrays.asList(str));
        System.out.println(arrayList.toString());
        int[] array = {1,2,4,5};
        List<Integer> list = Arrays.stream(array).boxed().toList();
        List<String> list1 = Arrays.asList(str);
        List<String> list2 = new ArrayList<>(Arrays.asList(str));
        //list1.add("123");
       // System.out.println(list1.toString());
        list2.add("123");
        System.out.println(list2.toString());*/
    }
    public static void main2(String[] args) {
        int a = 2;
        int b = a>>1;
        int c= 00;
        System.out.println(c);
        System.out.println(b);
        System.out.println(b);
        System.out.println(b);
        System.out.println(b);
    }
    public static void main1(String[] args) {
        MyArrayList test = new MyArrayList();
        int[] array = {0,1,2,3,4,5};
        test.add(2);
        test.add(12);
        test.add(123);
        test.add(234);
        test.add(25);
       /* test.remove(0);
         test.display();
        System.out.println(test.size());
        System.out.println(test.elementDataLength());*/
        test.set(0,23);
        /*test.addAll(1,array);
        test.display();
        System.out.println(test.elementDataLength());*/
        test.add(0,3);
        test.addAll(1,array);
        System.out.println(test.indexOf(1));
        System.out.println(test.contains(123));
        System.out.println(test.get(3));
//        test.display();
        System.out.println(test.remove(3));
        System.out.println(test.size());
        System.out.println(test.elementDataLength());
        test.display();


    }
}
